﻿using RockHopper.Common.Data;
using RockHopper.Common.IoC;
using RockHopper.Common.Services;
using RockHopper.Common.ViewModel;
using RockHopper.TrainingCalculator.WinRT.Data;
using RockHopper.TrainingCalculator.WinRT.ViewModel;

namespace RockHopper.TrainingCalculator.WinRT
{
    internal static class Global
    {
        internal static Container Container { get; private set; }

        internal static void Init()
        {
            Container = new Container();
            Container.AddComponent<ISettingsRepository, SettingsRepository>();
            Container.AddComponent<IDataRepository, DataRepository>();
            Container.AddComponent<ViewModelBase, MainViewModel>(typeof(MainViewModel).Name);
            Container.AddComponent<TileViewModel, EasyTileViewModel>(typeof (EasyTileViewModel).Name);
            Container.AddComponent<TileViewModel, VdotTileViewModel>(typeof(VdotTileViewModel).Name);
            Container.AddComponent<TileViewModel, MarathonTileViewModel>(typeof(MarathonTileViewModel).Name);
            Container.AddComponent<TileViewModel, ThresholdTileViewModel>(typeof(ThresholdTileViewModel).Name);
            Container.AddComponent<TileViewModel, IntervalTileViewModel>(typeof(IntervalTileViewModel).Name);
            Container.AddComponent<TileViewModel, RepetitionTileViewModel>(typeof(RepetitionTileViewModel).Name);
            Container.AddComponent<TileViewModel, RacePredictorTileViewModel>(typeof(RacePredictorTileViewModel).Name);
            Container.AddComponent<TileViewModel, WindEffectTileViewModel>(typeof(WindEffectTileViewModel).Name);
            Container.AddComponent<TileViewModel, TempEffectTileViewModel>(typeof(TempEffectTileViewModel).Name);
            Container.AddComponent<TileViewModel, HeartRateTileViewModel>(typeof(HeartRateTileViewModel).Name);
            Container.AddComponent<ViewModelBase, UnitsViewModel>(typeof (UnitsViewModel).Name);
            Container.AddComponent<ViewModelBase, GeneralViewModel>(typeof(GeneralViewModel).Name);
            Container.AddComponent<ICalculationService, CalculationService>();

        }
    }
}